Skip to content

feat: Save as…, with a public copy of the deck to hand out - #12

Merged
roaldnefs merged 2 commits into
roaldnefs:mainfrom
victorbahl:feat/save-as-public-copy
Nov 17, 2026
Merged

roaldnefs merged 2 commits into
roaldnefs:mainfrom
victorbahl:feat/save-as-public-copy

Conversation

@victorbahl

@victorbahl victorbahl commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Hey Roald, glad you liked the previous PRs 🙌 It's a pleasure to work on this.

Here's the one for #9, as you suggested 🙂

What it does

A button in the edit view makes a public copy of the deck to hand out: the deck as it is now, without the speaker notes, the skipped slides, the layouts and the comments between the slides.

  • It says what it leaves out before it makes the copy.
  • In Chromium it asks where to put the copy, with name-public.html suggested; elsewhere it downloads it.
  • The copy opens without the edit view, and an inlined engine loses the code of that view: the example deck goes from 141 kB to 63 kB.
  • Your own file isn't touched, and unsaved edits stay unsaved.

How the trimming works

As described in the issue: two marker comments in deck.js around the edit view, and the copy cuts what is between them. Without the markers the copy simply keeps the whole engine, and still has no edit view. The test opens a public copy and checks that it is under 60% of the size, has none of the edit view's functions, navigates and throws no errors.

It's the small version on purpose. If you'd like the engine properly split in two blocks, viewer and editor, so that a copy just drops a block, I'd be glad to do it as a separate PR. It touches update, the template and existing decks, so I didn't want to slip it in here.

One difference from the issue

The button is called Save as… instead of "Public copy", and the public copy is the one choice in its panel. I have a follow-up about Save itself (see below) where a full copy joins it, and this way the button doesn't change name between two releases. If you'd rather have a plain "Public copy" button for now, that's a two-line change.

What comes next

While working on this I kept tripping over Save: it's easy to write a copy into Downloads without noticing. I have a fix that builds on this PR, with Save writing to the deck's own file and Save as… making the copies. It's a bigger change to how Save behaves, so I'll open it as its own PR once this one is in, and you can judge each on its own. The branch is here if you're curious: https://github.com/victorbahl/deckfile/tree/feat/save-to-deck-file

Testing

npm test: 13 node tests and 106 browser tests pass. One browser test is new: it makes a public copy through a stand-in dialog and as a download, then opens it and checks that it navigates, has no edit view and throws no errors. Checked by hand in Chrome on macOS.

Closes #9

victorbahl and others added 2 commits November 15, 2026 15:29
The Save as button in the edit view makes a public copy: the deck as it is
now under a name of its own, without the speaker notes, the skipped slides,
the layouts and the comments between the slides. It says what it leaves out
first. The copy opens without the edit view, and an engine inlined in it
loses the code of that view.
Save opens a menu with Save and Save public copy…, each saying what it
does; the public copy's line says what it leaves out. Cmd/Ctrl+S still
saves straight away. The menu looks like the layouts menu, and a button
whose menu is open stays lit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roaldnefs
roaldnefs merged commit 4641492 into roaldnefs:main Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public copy: a clean version of the deck to send out

2 participants